/*
 * Copyright 2010-2011 Sanjay Dwivedi.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.isdinvestments.cam.domain.model;

import java.io.Serializable;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;
import java.util.Set;


/**
 * The persistent class for the POSITION_TRANSACTION database table.
 * 
 */
@Entity
@Table(name="POSITION_TRANSACTION")
public class PositionTransaction implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="POSITION_TRANSACTION_ID_GENERATOR", sequenceName="POSITION_TRANSACTION_ID_SEQ")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="POSITION_TRANSACTION_ID_GENERATOR")
	private long id;

	@Column(name="CREATED_BY")
	private String createdBy;

    @Temporal( TemporalType.DATE)
	@Column(name="CREATED_DATE")
	private Date createdDate;

	@Column(name="POSITION_ID")
	private BigDecimal positionId;

    @Temporal( TemporalType.DATE)
	@Column(name="TRANSACTION_DATE")
	private Date transactionDate;

	@Column(name="TRANSACTION_UNITS")
	private BigDecimal transactionUnits;

	@Column(name="UNIT_PRICE")
	private BigDecimal unitPrice;

	@Column(name="UPDATED_BY")
	private String updatedBy;

    @Temporal( TemporalType.DATE)
	@Column(name="UPDATED_DATE")
	private Date updatedDate;

	//bi-directional many-to-one association to PositionTransaction
    @ManyToOne
	@JoinColumn(name="TRANSACTION_PAIR_ID")
	private PositionTransaction positionTransaction;

	//bi-directional many-to-one association to PositionTransaction
	@OneToMany(mappedBy="positionTransaction")
	private Set<PositionTransaction> positionTransactions;

	//bi-directional many-to-one association to TransactionAction
    @ManyToOne
	@JoinColumn(name="TRANSACTION_ACTION")
	private TransactionAction transactionAction;

	//bi-directional many-to-one association to TransactionAction
    @ManyToOne
	@JoinColumn(name="TRANSACTION_TYPE")
	private TransactionType transactionType;

	//bi-directional many-to-one association to ReferenceData
    @ManyToOne
	@JoinColumn(name="STATUS")
	private TransactionStatus transactionStatus;

    public PositionTransaction() {
    }

	public long getId() {
		return this.id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getCreatedBy() {
		return this.createdBy;
	}

	public void setCreatedBy(String createdBy) {
		this.createdBy = createdBy;
	}

	public Date getCreatedDate() {
		return this.createdDate;
	}

	public void setCreatedDate(Date createdDate) {
		this.createdDate = createdDate;
	}

	public BigDecimal getPositionId() {
		return this.positionId;
	}

	public void setPositionId(BigDecimal positionId) {
		this.positionId = positionId;
	}

	public Date getTransactionDate() {
		return this.transactionDate;
	}

	public void setTransactionDate(Date transactionDate) {
		this.transactionDate = transactionDate;
	}

	public BigDecimal getTransactionUnits() {
		return this.transactionUnits;
	}

	public void setTransactionUnits(BigDecimal transactionUnits) {
		this.transactionUnits = transactionUnits;
	}

	public BigDecimal getUnitPrice() {
		return this.unitPrice;
	}

	public void setUnitPrice(BigDecimal unitPrice) {
		this.unitPrice = unitPrice;
	}

	public String getUpdatedBy() {
		return this.updatedBy;
	}

	public void setUpdatedBy(String updatedBy) {
		this.updatedBy = updatedBy;
	}

	public Date getUpdatedDate() {
		return this.updatedDate;
	}

	public void setUpdatedDate(Date updatedDate) {
		this.updatedDate = updatedDate;
	}

	public PositionTransaction getPositionTransaction() {
		return this.positionTransaction;
	}

	public void setPositionTransaction(PositionTransaction positionTransaction) {
		this.positionTransaction = positionTransaction;
	}
	
	public Set<PositionTransaction> getPositionTransactions() {
		return this.positionTransactions;
	}

	public void setPositionTransactions(Set<PositionTransaction> positionTransactions) {
		this.positionTransactions = positionTransactions;
	}
	
	public TransactionAction getTransactionAction() {
		return this.transactionAction;
	}

	public void setTransactionAction(TransactionAction transactionAction) {
		this.transactionAction = transactionAction;
	}
	
	public TransactionStatus getTransactionStatus() {
		return this.transactionStatus;
	}

	public void setTransactionStatus(TransactionStatus transactionStatus) {
		this.transactionStatus = transactionStatus;
	}
	
	public TransactionType getTransactionTYpe() {
		return this.transactionType;
	}

	public void setTransactionType(TransactionType transactionType) {
		this.transactionType = transactionType;
	}
	
}